﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="copyright" content="Copyright 2016 Hydra,Co.,Ltd" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <title></title>
    <link rel="icon" type="image/png" href="../assets/images/favicon.png">
    <link href="../assets/style/retinacommon.css" rel="stylesheet" />
    <link href="../assets/style/amazeui.css" rel="stylesheet" />
    <link href="../assets/style/simplify.css" rel="stylesheet" />
    <style>
        .header { text-align: center; }
            .header h1 { font-size: 200%; color: #333; margin-top: 30px; }
            .header p { font-size: 14px; }
    </style>

</head>
<body app-view>
    <!--[if lte IE 9]>
        <p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，UI 暂不支持。 请 <a href="#" target="_blank">升级浏览器</a>
            以获得更好的体验！
        </p>
    <![endif]-->
    <div class="header">
        <hr />
    </div>
    <div class="am-g">
        <div class="sign-in-wrapper">
            <div class="sign-in-inner">
                <div class="login-brand text-center">
                    <i class="fa fa-database m-right-xs"></i> Hydra <strong class="text-skin">Admin</strong>
                </div> 
            </div><!-- ./sign-in-inner -->
        </div>
        <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
            
            <div class="am-btn-group">
                <a href="#" class="am-btn am-btn-secondary am-btn-sm"><i class="am-icon-qq am-icon-sm"></i> QQ登录</a> 
                <a href="#" class="am-btn am-btn-success am-btn-sm"><i class="am-icon-weixin am-icon-sm"></i> 微信登录</a> 
            </div>
            <br>
            <br>

            <form id="login-form" method="post" class="am-form" autocomplete="off">
                <label for="name">姓名 OR 易记码:</label>
                <input type="text" name="name" id="name">
                <br>
                <label for="pwd">密码:</label>
                <input type="password" name="pwd" id="pwd">
                <br>
                <label for="remember-me">
                    <input id="remember-me" type="checkbox"> 记住密码
                </label>
                <br />
                <div class="am-cf">
                    <input type="submit" value="登 录" class="am-btn am-btn-primary am-btn-sm am-fl">
                    <a href="javascript:;" class="am-btn am-btn-default am-btn-sm am-fr">忘记密码 ^_^? </a>
                </div>
            </form>
            <hr>
            <p>© 2016 版权所有.  <a href="http://www.wybashi.com" target="_blank">网约巴士</a></p>
        </div>
    </div>


<script src="../assets/jsplugin/jquery-1.11.1.min.js"></script>
<script src="../assets/jsplugin/bootstrap.min.js"></script>
<script src="../assets/jsplugin/layer/layer.js"></script>
<script src="../assets/jsplugin/layer/extend/layer.ext.js"></script>
<script src="../config/vp.config.js"></script>
<script src="../config/core.js"></script>
<script type="text/javascript">
var login = function () {
	var $form = $("#login-form");
    var _this = {
        initEvent: function () {
        	$form.submit(function(){
        		var name = $form.find("#name").val();
        		var pwd = $form.find("#pwd").val();
        		if(!name || !pwd){
                    layer.msg('透明人与黑客不得入内...', {icon: 2});
        			return false;
        		}
        		console.log(111)
        		App.ajax({
                    data: {"user.name":name, "user.pwd":pwd},
                    resUrl: "/user/login",
                    callback: function (rb) {
                        if(!rb.status){
                            layer.msg('登录不成功', {icon: 5});
                        	return;
                        }
                        window.location.href = "index.html"+(window.location.hash||"");
//                      window.location.reload();//防止跳转不了，再次重定向 
                    } 
        		}); 
        		return false;
        	});
        },
        init: function () {
            _this.initEvent();
        }
    }
    return _this;
}();
$(function(){
	login.init();
});
</script>
    
</body>
</html>
